package com.ceuer.demo.thread;

//练习Thread，实现多线程同步下载图片
public class Demo1DownLoad extends Thread {
	private String url;
	private String name;
	
	public Demo1DownLoad(String url,String name) {
		this.url = url;
		this.name = name;
	}
	
	public static void main(String[] args) {
		new Demo1DownLoad("https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png", "1.png").start();
		new Demo1DownLoad("https://www.baidu.com/img/flexible/logo/pc/peak-result.png", "2.png").start();
		new Demo1DownLoad("https://www.baidu.com/img/flexible/logo/pc/result.png", "3.png").start();
	}
	
	@Override
	public void run() {
		WebDownLoader webDownLoader=new WebDownLoader();
		webDownLoader.downloader(url,name);
		System.out.println("下载了文件名为--->"+name);
	}
}